﻿<html class="hb-loaded">
 <head> 
  <meta charset="utf-8" /> 
  <title>会员登录</title> 
  <meta name="Keywords" content="Darry Ring钻戒价格,Darry Ring钻戒图片" /> 
  <meta name="Description" content="Darry Ring官网会员注册登录唯一入口，Darry Ring是求婚钻戒第一品牌，想了解Darry Ring实体店、Darry Ring哪里有卖等相关Darry Ring资讯就先进入戴瑞珠宝官网注册吧！" /> 
  <meta content="26403151123072464122121676375" property="qc:admins" /> 
  <link href="css/style.css" type="text/css" rel="stylesheet" />
 </head>
 <body>
  <script src="../js/jquery.js" type="text/javascript"></script>
  <script src="../js/common.js" type="text/javascript"></script>
  <div class="wrap"> 
   <!-- start of 头部导航--> 
   <div class="head_top"> 
    <div class="head clearfix"> 
     <!--头部左边--> 
     <div class="topLeft left"> 
      <a href="../home/home.html" title="Darry Ring"> <img width="186" height="42" src="image/logo_01.png " /> </a>
      <span>求婚钻戒领导品牌</span> 
     </div> 
     <!--头部左边end--> 
     <!--头部右边--> 
     <ul class="topRight right"> 
      <li>国际权威认证</li> 
      <li class="tr_2">15天无理由退换</li> 
      <li class="tr_3">终身保养</li> 
     </ul> 
     <!--头部左边end--> 
    </div> 
   </div> 
   <!--end of 头部导航--> 
   <!-- starto of container --> 
   <div class="container"> 
    <!--中间内容--> 
    <div class="cmain ddd"> 
     <!--内容右边--> 
     <div class="cort-right right"> 
      <div class="r_bg"></div> 
      <!--登陆框内--> 
      <form method="post" action="LoginServlet" id="loginform">
       <div class="cr_border"> 
        <h3></h3> 
        <!--邮箱--> 
        <div id="cssName" class="the_input">
         <span class="member"></span> 
         <input type="email" placeholder="请输入邮箱" id="email" class="al_Input dr_email" value="" name="email" />
         <i id="name"></i>
        </div> 
        <!--邮箱end--> 
        <!--密码--> 
        <div style="margin-top:15px;" class="the_input" id="CssPwd">
         <span class="password"></span> 
         <input type="password" placeholder="请输入密码" id="password" class="al_Input" value="" name="password" />
         <i id="pwd"></i>
        </div> 
        <!--验证码--> 
        <!--验证码end--> 
        <!--报错信息--> 
        <div class="ts_wrong" id="showWrong" style="display: none"> 
         <span id="wrong"> <span id="Label1">Label</span></span> 
        </div> 
        <!--报错信息end--> 
        <!--其他选项-->
        <!--按钮--> 
        <div class="other_input"> 
         <div class="bt1 clearfix" id="login">
          <span class="left">注册</span> 
          <span class="right focus" id="login-home">登录</span>
         </div> 
        </div> 
        <!--按钮end--> 
        <!--其他合作--> 
        <div class="other_hz"> 
         <p> <span>更多合作网站帐号登录:</span> <a href="/syncLogin/qq" class="oth_qq" target="black"></a> <a href="/syncLogin/weibo" class="oth_wb" target="black"></a> <a href="/syncLogin/weixin" class="oth_wx" target="black"></a> </p> 
        </div> 
        <!--其他合作end--> 
       </div> 
       <input type="hidden" value="index.html" name="forward" /> 
      </form> 
      <!--登陆框内end--> 
     </div> 
     <!--内容右边end--> 
    </div> 
    <!--中间内容end--> 
   </div> 
   <!-- end of container --> 
   <!--底部end--> 
   <div class="cmain bc_yz"> 
    <div class="db_cort"> 
     <p>Copyright &copy; 2006-2015  戴瑞珠宝 All Rights Reserved. 粤ICP备XXX号</p> 
     <p>中国互联网违法信息举报中心 | 中国公安网络110报警服务 | 本网站提供所售商品的正式发票</p> 
    </div> 
   </div>
  </div> 

  <script type="text/javascript">
	$(document).ready(function() {
     //注册页面跳转
     $('#login span').eq(0).click(function() {
      location.href ="register.html"
     });
     //登录成功跳转页面
         $("#login-home").click(function () {
          var email = $("#email").val();
          var password = $("#password").val();
          var emailType = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,})$/;

          $('.ts_wrong').remove();
          $('.the_input').removeClass('error');
          if ($('#email').val() == ''||$('#email').val() == null) {
           var notice = '<div class="ts_wrong"><span id="wrong">请输入邮箱!</span></div>';
           $('#email').parent().after(notice);
           $('#email').parent().addClass('error');
           return false;
          }else if (emailType.test(email) == false){
           var notice = '<div class="ts_wrong"><span id="wrong">邮箱格式错误!</span></div>';
           $('#email').parent().after(notice);
           $('#email').parent().addClass('error');
           return false;
          }

          if ($('#password').val() == ''||$('#password').val() == null) {
           var notice = '<div class="ts_wrong"><span id="wrong">请输入密码！</span></div>';
           $('#password').parent().after(notice);
           $('#password').parent().addClass('error');
           return false;
          }

          $.getJSON("http://localhost:8080/DiamondRing/LoginServlet","email="+email+"&password="+password,function (data) {
           if (data>0){
            alert("登录成功!")
            location.href =  "../home/home.html"
           }else{
            alert("密码或邮箱错误,请重新登录!")
           }
          });
         });
	});
        
        $(document).keyup(function(event){
            if(event.keyCode ==13){
               $('#login-home').click();
            }
        });
</script>
 </body>
</html>